package com.proscenic.ops.mp.controller;

import com.proscenic.ops.mp.service.MaterialService;
import com.proscenic.ops.common.vo.ResultVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * @version 1.0
 * created by chenxin on 2021/11/1 16:48
 */
@RestController
@RequestMapping("/api/mp/material")
@Api(tags = {"素材管理"})
public class MaterialController {
    @Resource
    private MaterialService materialService;

    @ApiOperation("上传其他类型素材")
    @PostMapping("/fileUpload")
    public ResultVO upload(HttpServletRequest request, String type, MultipartFile file){
        return materialService.upload(request, type, file);
    }
}
